from django.db import models


class ClassList(models.Model):
    """
    班级
    """
    school_choices = (
        (1, '北京'),
        (2, '上海'),
        (3, '深圳'),
    )
    school = models.SmallIntegerField(verbose_name='校区', choices=school_choices, default=1)

    course_choice = (
        (1, 'Python'),
        (2, 'Linux'),
        (3, 'Go'),
    )
    course = models.SmallIntegerField(verbose_name='学科', choices=course_choice, default=1)
    title = models.CharField(verbose_name='班级', max_length=32)
    org = models.CharField(verbose_name='组织', max_length=32)
    teach_repo = models.CharField(verbose_name='教学仓库', max_length=32, default='teaching_plan')


class Member(models.Model):
    """
    成员
    """
    cls = models.ForeignKey(verbose_name='班级', to='ClassList')
    username = models.CharField(verbose_name='码云用户名', max_length=32, db_index=True)
    real_name = models.CharField(verbose_name='姓名', max_length=32)
    nick_name = models.CharField(verbose_name='昵称', max_length=32, null=True)
    repo_name = models.CharField(verbose_name='仓库名称', max_length=32, db_index=True)
